package com.gitee.wsl.collections.api

/**
 * Defines a collection that is bounded in size.
 *
 *
 * The size of the collection can vary, but it can never exceed a preset
 * maximum number of elements. This interface allows the querying of details
 * associated with the maximum number of elements.
 *
 *
 * @see CollectionUtils.isFull
 *
 * @see CollectionUtils.maxSize
 *
 * @param <E> the type of elements in this collection
 * @since 3.0
</E> */
interface BoundedCollection<E> : Collection<E> {
    /**
     * Returns true if this collection is full and no new elements can be added.
     *
     * @return `true` if the collection is full.
     */
    val isFull: Boolean

    /**
     * Gets the maximum size of the collection (the bound).
     *
     * @return the maximum number of elements the collection can hold.
     */
    val maxSize: Int
}